﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddCondPag.aspx.cs" Inherits="NewTierra.Pages.AddCondPag" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

    <link rel="shortcut icon" href="../../images/Icones/favicon.ico" type="image/x-icon" />

    <link href="../../Styles/jquery_notification.css" rel="stylesheet" />

    <link href="../../Styles/jquery-ui.css" rel="stylesheet" />    
    <script type="text/javascript" src="../../Scripts/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.10.0.js"></script>

    <script type="text/javascript" src="../../Scripts/jquery_notification_v.1.js"></script>

    <link href="~/Styles/EstiloGeral.css" rel="stylesheet" type="text/css" />

    <title></title>
    <style type="text/css">
        #FormCond
        {
            height: 362px;
            width: 899px;
        }

            #FormCond .GridCond
            {
                float: left;
                height: 240px;
                width: 424px;
                margin-top: 10px;
            }

            #FormCond .FormCadastroCond
            {
                float: left;
                width: 452px;
                height: 307px;
            }

        .invisible
        {
            display: none;
        }

        .btnAddCond
        {
            height: 39px;
        }
    </style>

    <script type="text/javascript">
        function showAutoCloseMessage(MsgsExc) {
            showNotification({
                message: MsgsExc,
                autoClose: true,
                type: "success",
                duration: 3
            });
        }
    </script>

</head>
<body>

    <form id="form1" runat="server">

        <asp:ScriptManager ID="ScriptManager1" runat="server" />

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>

                <div id="FormCond">

                    <div class="FormCadastroCond">

                        <fieldset style="height: 349px">
                            <legend>Cadastrar Contatos</legend>

                            <asp:TextBox ID="txtCodigo" CssClass="invisible" runat="server" ReadOnly="True" Width="50px" />

                            <p class="paragrafo">
                                <asp:Label ID="lblSupplierTXT" runat="server" Text="Supplier:"></asp:Label>&nbsp;
                                <asp:Label ID="lblSupplier" runat="server" Font-Size="Small"></asp:Label>
                            </p>

                            <p class="paragrafo">
                                <asp:Label ID="lblFonteCambioTXT" runat="server" Text="Fonte Cambio:"></asp:Label>
                                <br />
                                <asp:TextBox ID="txtFonte" runat="server" Width="300px" MaxLength="100" />
                                <%--<asp:RequiredFieldValidator ID="requireFonte" runat="server"
                                    ControlToValidate="txtFonte" ErrorMessage="*" ForeColor="Red"
                                    ToolTip="Campo requerido." ValidationGroup="Salvar">
                                </asp:RequiredFieldValidator>--%>
                            </p>

                            <p class="paragrafo">
                                <asp:Label ID="lblTipoCambioTXT" runat="server" Text="Tipo Cambio:"></asp:Label>
                                <br />
                                <asp:DropDownList ID="ddlTipoCambio" runat="server">
                                    <asp:ListItem Value="0" Text="Sem tipo..." />
                                    <asp:ListItem Value="Comercial Compra" Text="Comercial Compra" />
                                    <asp:ListItem Value="Comercial Venda" Text="Comercial Venda" />
                                    <asp:ListItem Value="Turismo Compra" Text="Turismo Compra" />
                                    <asp:ListItem Value="Turismo Venda" Text="Turismo Venda" />
                                    <asp:ListItem Value="Paralelo Compra" Text="Paralelo Compra" />
                                    <asp:ListItem Value="Paralelo Venda" Text="Paralelo Venda" />
                                    <asp:ListItem Value="Cambio Empresa" Text="Cambio Empresa" />
                                    <asp:ListItem Value="Travel Cheque" Text="Travel Cheque" />
                                    <asp:ListItem Value="Travel Cheque US$" Text="Travel Cheque US$" />                                                                                                                                                                                               
                                </asp:DropDownList>
                            </p>

                            <p class="paragrafo">
                                <asp:Label ID="lblDataCambioTXT" runat="server" Text="Data Cambio de Troca:"></asp:Label>
                                <br />
                                <asp:RadioButtonList ID="rdoDataCambio" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Value="in" Text="Chek-in" Selected="True" />
                                    <asp:ListItem Value="out" Text="Chek-out" />                                   
                                </asp:RadioButtonList>
                            </p>

                            <p class="paragrafo">
                                <asp:Label ID="lblPrazoFaturamentoTXT" runat="server" Text="Prazo Faturamento:"></asp:Label>
                                <br />
                                <asp:TextBox ID="txtPrazoFat" runat="server" Width="50px" MaxLength="50" />
                            </p>

                            <p class="paragrafo">
                                <asp:Label ID="lblBanco" runat="server" Text="Banco:"></asp:Label>
                                <br />
                                <asp:TextBox ID="txtBanco" runat="server" Width="150px" MaxLength="50" placeholder="Banco" />
                                <asp:TextBox ID="txtAgencia" runat="server" Width="100px" MaxLength="20" placeholder="Agência"/>
                                <asp:TextBox ID="txtConta" runat="server" Width="150px" MaxLength="20" placeholder="Conta"/>                                
                            </p>                            

                            <div class="btnAddCond">
                                <asp:Button ID="btnNovaCondPag" CssClass="btnGeralAzul" runat="server" Text="Salvar" ValidationGroup="Salvar" OnClick="SalvarCond" />
                                <asp:Button ID="btnUpdateCondPag" CssClass="btnGeralAzul" runat="server" OnClick="AtualizarCond" Text="Atualizar" ValidationGroup="Salvar" />
                                <asp:Button ID="btnLimpar" CssClass="btnGeralAzul" runat="server" Text="Limpar" OnClick="Limpar" />
                                <asp:Button ID="btnFechar" CssClass="btnGeralAzul" runat="server" OnClientClick="window.close();" Text="Fechar" />
                            </div>

                            <asp:Label ID="lblMsgAddCond" runat="server" Font-Bold="True" ForeColor="#CC0000" Font-Size="Small"></asp:Label>

                        </fieldset>
                    </div>

                    <div class="GridCond">

                        <asp:GridView ID="GridCond" runat="server" AllowPaging="True"
                            AutoGenerateColumns="False" GridLines="None" CssClass="mGrid" PagerStyle-CssClass="pgr"
                            AlternatingRowStyle-CssClass="alt" OnPageIndexChanging="PaginarDados" 
                            EmptyDataText="Não existe cadastro para esse Supplier."
                            Height="16px" PageSize="8">
                            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>

                            <Columns>
                                <asp:BoundField DataField="CondPag_id" HeaderText="ID" ReadOnly="True"
                                    SortExpression="CondPag_id" InsertVisible="False">
                                    <FooterStyle CssClass="invisible" />
                                    <HeaderStyle CssClass="invisible" />
                                    <ItemStyle CssClass="invisible" />
                                </asp:BoundField>

                                <asp:BoundField DataField="CondPag_fontecambio" HeaderText="Fonte"
                                    SortExpression="CondPag_fontecambio" />

                                <asp:BoundField DataField="CondPag_tipocambio" HeaderText="Tipo Cambio"
                                    SortExpression="CondPag_tipocambio" />

                                <asp:BoundField DataField="CondPag_datatroca" HeaderText="Data Cambio Troca"
                                    SortExpression="CondPag_datatroca" />

                                <asp:BoundField DataField="CondPag_prazofaturamento" HeaderText="Prazo Fat"
                                    SortExpression="CondPag_prazofaturamento" />

                                <%--<asp:BoundField DataField="CondPag_banco" HeaderText="Banco"
                                    SortExpression="CondPag_banco" />

                                <asp:BoundField DataField="CondPag_agencia" HeaderText="Agência"
                                    SortExpression="CondPag_agencia" />

                                <asp:BoundField DataField="CondPag_conta" HeaderText="Conta"
                                    SortExpression="CondPag_conta" />--%>
                                
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="EditarCond"
                                            runat="server" CommandArgument='<%# Eval("CondPag_id") %>'
                                            OnCommand="EditarCond"
                                            ToolTip="Editar Condição de Pagamento" ImageUrl="~/images/Icones/edit.png" />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="ExluirCond"
                                            runat="server" CommandArgument='<%# Eval("CondPag_id") %>'
                                            OnCommand="ExcluirCond"
                                            ToolTip="Excluir Condição de Pagamento" ImageUrl="~/images/Icones/delete.png" />
                                    </ItemTemplate>
                                    <HeaderStyle Wrap="False" />
                                    <ItemStyle Wrap="False" />
                                </asp:TemplateField>

                            </Columns>

                            <PagerStyle CssClass="pgr"></PagerStyle>

                        </asp:GridView>

                    </div>

                </div>

            </ContentTemplate>
        </asp:UpdatePanel>

    </form>

</body>
</html>
